package com.young.api.order;

import com.github.pagehelper.PageInfo;
import com.young.req.order.GetOrderPageReq;
import com.young.res.order.GetOrderPageRes;
import com.young.shop.service.order.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: 订单管理Api
 * @Author: kangyang
 * @Date: 2021/5/18 17:47
 **/
@RestController
@RequestMapping("/order/order")
public class OrderController {

  @Autowired
  private OrderService orderService;


  @GetMapping("/page")
  public ResponseEntity<PageInfo<GetOrderPageRes>> pageOrder(GetOrderPageReq getOrderPageReq) {
    PageInfo<GetOrderPageRes> orderPageResPageInfo = orderService.getOrderPage(getOrderPageReq);
    return ResponseEntity.ok(orderPageResPageInfo);
  }


}
